import request from '@/utils/request'

// 查询歌单-歌曲列表
export function listPTracks(query) {
  return request({
    url: '/playlist/pTracks/list',
    method: 'get',
    params: query
  })
}

// 查询歌单-歌曲详细
export function getPTracks(playlistId) {
  return request({
    url: '/playlist/pTracks/' + playlistId,
    method: 'get'
  })
}

// 新增歌单-歌曲
export function addPTracks(data) {
  return request({
    url: '/playlist/pTracks',
    method: 'post',
    data: data
  })
}

// 修改歌单-歌曲
export function updatePTracks(data) {
  return request({
    url: '/playlist/pTracks',
    method: 'put',
    data: data
  })
}

// 删除歌单-歌曲
export function delPTracks(playlistId) {
  return request({
    url: '/playlist/pTracks/' + playlistId,
    method: 'delete'
  })
}

export function getTrackTitles(playlistId) {
  return request({
    url: `/playlist/pTracks/trackDetails/${playlistId}`,
    method: 'get'
  });
}
